<template>
	<view class="container ">
    <up-parse class="content agreement_cnt" :content="data.agreement"></up-parse>

	</view>
</template>

<script setup>
	import {ref,reactive,getCurrentInstance} from "vue";
	import {onLoad,onShow,onPullDownRefresh,onReachBottom} from "@dcloudio/uni-app";
	const {proxy} = getCurrentInstance();
	const data = reactive({
		agreement:''
	})
	onLoad((option)=>{
		if(option.code==0){
			uni.setNavigationBarTitle({ title: '隐私协议' })
		}else if(option.code==1){
			uni.setNavigationBarTitle({ title: '用户协议' })
		}else{
			uni.setNavigationBarTitle({ title: '商家入驻协议' })
		}
		getAgreement(option.code)
	})
	onShow(()=>{
	})
	onPullDownRefresh(()=> {
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
		})
	onReachBottom(()=>{
		console.log('onReachBottom')
	})


	function getAgreement (code){
		proxy.$request({
			url: `api/agreement/?code=${code}`,
			method: 'get',
			success(res) {
				data.agreement=res.data
			}
		})
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #fff;
	}
	.container{
		padding: 30upx;
		.content{

		}
	}
</style>
<style lang="scss">
.agreement_cnt{
  max-width: 100vw!important;
  overflow-x: hidden !important;

  :deep(div:has(table)){
    max-width: 100%!important;
    overflow: auto;
    margin: 20rpx 0;
    table{
      border-spacing: 0;
      border-collapse: collapse;
    }
    td{
      border: 1px solid #ddd;
      text-align: center;
    }
  }
}
</style>
